package com.seven.sevenpicturebase.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.seven.sevenpicturebase.domain.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.seven.sevenpicturebase.model.dto.user.UserQueryRequest;
import com.seven.sevenpicturebase.model.vo.LoginUserVO;
import com.seven.sevenpicturebase.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Dell
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-02-10 13:35:54
*/
public interface UserService extends IService<User> {
    /**
     * 用户注册
     *
     * @param userAccount   用户账户
     * @param userPassword  用户密码
     * @param checkPassword 校验密码
     * @return 新用户 id
     */
    long userRegister(String userAccount, String userPassword, String checkPassword);

    LoginUserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);

    User getLoginUser(HttpServletRequest request);

    String getEncryptPassword(String userPassword);

    boolean userLogout(HttpServletRequest request);

    LoginUserVO getLoginUserVO(User user);

    UserVO getUserVO(User user);

    List<UserVO> getUserVOList(List<User> userList);

    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    boolean isAdmin(User user);
}
